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3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,
0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,
0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,
0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,0X3F,
};

const unsigned char gImage_app[24] = { /* 0X22,0X01,0X0C,0X00,0X0C,0X00, */
0X01,0XFD,0XFD,0XFD,0XE7,0XC0,0XC0,0XE7,0XFD,0XFD,0XFD,0X01,0X0C,0X0C,0X0D,0X0D,
0X05,0X01,0X05,0X01,0X05,0X0D,0X0C,0X0C,};

const unsigned char gImage_home[24] = { /* 0X22,0X01,0X0C,0X00,0X0C,0X00, */
0XFF,0X9F,0X0F,0X07,0X03,0X80,0X80,0X80,0X03,0X07,0X0F,0X9F,0X0F,0X0F,0X00,0X00,
0X00,0X0F,0X0F,0X0F,0X00,0X00,0X00,0X0F,};


res_entry_t image_res[] = {   
        {  3, 2, gImage_logo, 256, 64, 30, },
        {  4, 2, gImage_app, 24, 12, 12, },
        {  5, 2, gImage_home, 24, 12, 12, }};
        
int find_resource_by_c(uint32_t id, res_entry_t * res)
{
       memcpy( res, &image_res[id - RES_ID_LOGO], sizeof( res_entry_t ));  
       return 0;
}

void get_resource_by_c(res_entry_t * res, uint8_t * buf)
{
    memcpy( buf, res->offset, res->size );
    buf[res->size] = '\0';
}

